Skip to content

Fix port range splitting crash due to u16 overflow#1918

Open
fristonio wants to merge 1 commit into
mainfrom
pr/fristonio/fix/port-range-splitting-crash
Open

Fix port range splitting crash due to u16 overflow#1918
fristonio wants to merge 1 commit into
mainfrom
pr/fristonio/fix/port-range-splitting-crash

Conversation

@fristonio
Copy link
Copy Markdown
Member

See commit message for details.
Fixes cilium/cilium#45811

This commit fixes a crash in proxy during port range splitting caused by
u16 overflow when inserting a port range with `end_port` U16_MAX that
overlaps with existing port range end port.

The crash happens due to port range splitting algorithm incorrectly
attempting to insert a overlapping port range that should already be
covered by an existing port range. This commit fixes the issue by
skipping port range insert when the new range is already covered by
iterator at the end.

Fixes cilium/cilium#45811

Signed-off-by: Deepesh Pathak <deepeshpathak09@gmail.com>
@fristonio fristonio added bug Something isn't working needs-backport/1.36 labels May 24, 2026
@fristonio fristonio marked this pull request as ready for review May 24, 2026 21:38
@fristonio fristonio requested a review from a team as a code owner May 24, 2026 21:38
@fristonio fristonio requested a review from nezdolik May 24, 2026 21:38
@fristonio fristonio requested a review from jrajahalme May 25, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-backport/1.36

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cilium-envoy RELEASE_ASSERT crash in PortNetworkPolicy when NPDS delivers overlapping port ranges with different endPort

2 participants